#ifndef F4XX_LCD_MIDDLE_H
#define F4XX_LCD_MIDDLE_H


#ifdef __cplusplus
	extern "C" {
#endif

#include "stm32f4xx.h"
#include "stm32f4xx_SSD1289.h"
#include "stm32f4xx_Types.h"
#include "LCD_Colour.h"
#include "LCD_Ascii.h"



/**
 * @brief Init the LCD parameters
 *
 * @param None
 *
 * @reval None
 */
void LCD_Init(void);

/**
 * @brief Write value to the Register of the LCD
 *
 * @param UIN16 Reg_Add : address of the register
 *
 * @param UIN16 Reg_Value : Value to write to register
 *
 * @reval None
 */
void LCD_WriteReg(UIN16 Reg_Add, UIN16 Reg_Value);

/**
 * @brief Write value to the GRAM (pixel point)
 *
 * @param UIN16 Pix_Value : value to write to the pixel
 *
 * @reval None
 */
void LCD_WritePixel(UIN16 Pix_Value);

/**
 * @brief Set up a small windown inside the LCD
 *
 * @param struct LCD_Coord * Pos : contain the begin coordinators, length and width of window
 *
 * @reval None
 */
void LCD_SetWindow(struct LCD_Coord * Pos);

/**
 * @brief Close the last window which was opened
 *
 * @param None
 *
 * @reval None
 */
void LCD_CloseWindow(void);

/**
 * @brief Fill the window with one colour
 *
 * @param UIN16 Color : Color that will be used for filling
 *
 * @param struct LCD_Coord * Pos : Window which will be filled
 *
 * @reval None
 */
void LCD_Clear(UIN16 Color, struct LCD_Coord * Pos);

/**
 * @brief function to test the LCD, note that it contain the while loop
 *
 * @param None
 *
 * @reval None
 */
void LCD_Test(void);

/**
 * @brief Set the X coordination of current pixel
 *
 * @param UIN16 X_Coord : X coordination
 *
 * @reval None
 */
inline void LCD_SetX(UIN16 X_Coord);

/**
 * @brief Set the Y coordination of current pixel
 *
 * @param UIN16 Y_Coord : Y coordination
 *
 * @reval None
 */
inline void LCD_SetY(UIN16 Y_Coord);

/**
 * @brief Write the GRAM mask
 *
 * @param UIN16 Mask1: mask register R23
 *
 * @param UIN16 Mask2: mask register R24
 *
 * @reval None;
 */
inline void LCD_Mask(UIN16 Mask1, UIN16 Mask2);

#ifdef __cplusplus
	}
#endif
#endif
